//
//  WHCompanyInfoApplyModel.h
//  WHEasyBizLink
//
//  Created by shengmeng chen on 2024/11/23.
//

#import <Foundation/Foundation.h>

@class WHTreeManager;

/////弹窗类型
//typedef enum : NSUInteger{
//    /// 单位名称
//    WHCellTypeName = 0,
//    /// 单位类型
//    WHCellTypeTradetype,
//    ///机构代码
//    WHCellTypeCode,
//    /// 所属区域
//    WHCellTypeRegion,
//    /// 开户银行名称
//    WHCellTypeBanknm,
//    /// 银行账户名称
//    WHCellTypeAccountnm,
//    /// 银行账号
//    WHCellTypeCcountno,
//    /// 单位地址
//    WHCellTypeAddr,
//    /// 单位电话
//    WHCellTypeTel,
//    /// 是否物联管理单位
//    WHCellTypeIsctr,
//    /// 单位序号
//    WHCellTypeSort,
//    
//}WHCellType;

#define kComName   @"单位名称"
#define kComType   @"单位类型"
#define kComCode   @"机构代码"
#define kBanknm    @"开户银行"
#define kBankSubnm @"开户支行"
#define kaccountnm @"户主名称"
#define kaccountno @"银行账号"
#define kComRegion @"单位区域"
#define kComAddr   @"单位地址"
#define kComPerson @"联系人"
#define kComTel    @"联系电话"
#define kIsManger  @"是否物联管理单位"


#define kComType99 @"ComType99" // 企业

///操作类型
typedef enum : NSUInteger{
    /// 删除
    WHComTypeDele = 0,
    ///增加
    WHComTypeAdd  = 1,
    ///修改
    WHComTypeMDF  = 2,
    ///启用、停用
    WHComTypeEnable =4,
    
} WHComOPType;




NS_ASSUME_NONNULL_BEGIN
@class WHEnterpriseCompanyModel;
@interface WHCompanyInfoApplyModel : NSObject

+ (void)fetchDatasSuccessBlock:(void (^)(id models))succese;
+ (void)fetchDatasWithModel:(WHEnterpriseCompanyModel*)companyModel SuccessBlock:(void (^)(id models))succese;

@property (nonatomic,strong)NSString *titleName;
@property (nonatomic,strong)NSString *holderName;
@property (nonatomic,strong)NSString *contents;//显示内容
@property (nonatomic,strong)NSString *code;//当单位类型是 单位类型代码
@property (nonatomic,assign)BOOL isMust;   //是否必填项
@property (nonatomic,assign)BOOL isSelect;

@property (nonatomic,assign)BOOL isShow;

@end

@interface WHInfoModel : NSObject

@property (nonatomic,strong)NSString *name;//单位名称
@property (nonatomic,strong)NSString *comid;//单位id
@property (nonatomic,strong)NSString *code;//机构代码
@property (nonatomic,strong)NSString *tradetype;//单位类型
@property (nonatomic,strong)NSString *region;//所属区域
@property (nonatomic,strong)NSString *banknm;//开户银行名称
@property (nonatomic,strong)NSString *bankcode;//开户银行代码，传开户银行的编码
@property (nonatomic,strong)NSString *subbanknm;//开户支行
@property (nonatomic,strong)NSString *accountnm;//银行账户名称
@property (nonatomic,strong)NSString *accountno;//银行账号
@property (nonatomic,strong)NSString *addr;//单位地址
@property (nonatomic,strong)NSString *linkuser;//联系人
@property (nonatomic,strong)NSString *tel;//单位电话
@property (nonatomic,strong)NSString *isctr;//是否物联管理单位
@property (nonatomic,strong)NSString *sort;//单位序号
@property (nonatomic,strong)NSString *udid;//注册手机唯一标识
@property (nonatomic,strong)NSString *number;//注册手机号码
@property (nonatomic,strong)NSString *brand;//手机品牌
@property (nonatomic,strong)NSString *brandmodel;//品牌型号

/// 转换模型
/// - Parameters:
///  - models: cell模型数组
///  -WHInfoModel model返回模型
+(WHInfoModel*)changeWHCompanyInfoApplyModels:(NSArray*)models;

/// 检查是否填写完成
/// - Parameters:
///  - model: 模型数
///  - succese   必填项完成
///  - failure 如果没有完成提示未填项
+(void)checkItem:(WHInfoModel*)model succesefulBlock:(void (^)(NSString* str))succese andFailureBlock:(void (^)(NSString *error))failure;


/// 单位开户
/// - Parameters:
///  - model: 模型数
///  - NSDictionary dict:  TDS信息字典（平台标识、代理地址、代理标识）
///    NSString: opertype  T:添加 0:删除 2:修改
///  - succese   必填项完成
///  - failure 如果没有完成提示未填项
+(void)sendCompanyInfo:(WHInfoModel*)model withTSD:(NSDictionary*)dict withopertype:(WHComOPType)opertype withBlock:(void (^)(id responseObject))succese failureBlock:(void (^)(NSString *msg))failure;
//操作公司
//comid 公司id
//dict TDSid:平台标识 url 代理地址
//opertype 0:删除 2:修改 4:启用/停用
//succese 成功
//failure 失败
+(void)setCompanyInfo:(NSString*)comid withTSD:(NSDictionary*)dict withopertype:(WHComOPType)opertype withBlock:(void (^)(id responseObject))succese failureBlock:(void (^)(NSString *msg))failure;

@end

//单位类型
@interface WHTradeTypeModel : NSObject

@property (nonatomic,strong)NSString *rn;//单位序号
@property (nonatomic,strong)NSString *code;//单位代码
@property (nonatomic,strong)NSString *name;//单位名称

/**4、查询系统代码信息
 入参描述：
 {
     "callMainTdsProc": "1",
     "callFromType": "0",
     "userid":"000000",
     "procId":"Pkg_Pbl_Def.p_Getsyscodeinfo",
     "pcode":"上级代码",
     "operuri" : "操作人标识",
     "operunm" : "操作人姓名"
 }
 
 出参描述
 {
   "dataListAllCount": 2,
   "dataList": [
     {
        "rn": "1",
        "code": "代码",
        "name": "名称"
     },
     {
        "rn": "2",
        "code": "代码",
        "name": "名称"
     }
   ],
   "code": "EC00",
   "msg": "处理成功"
 }
*/
+(void)getTDSSystemWithBlock:(void (^)(id responseObject))succese FailureBlock:(void (^)(NSString *msg))failure;

+(NSMutableArray*)getTitleUnitTypeInfo:(NSArray *)array;

@end

@interface WHRegionalModel : NSObject

@property (nonatomic,strong)NSString *rn;//单位名称
@property (nonatomic,strong)NSString *id;//区域标识
@property (nonatomic,strong)NSString *name;//区域名称
@property (nonatomic,strong)NSString *sort;//区域序号

+(void)getTDSRegionalWithPid:(NSString*)pid Block:(void (^)(id responseObject))succese FailureBlock:(void (^)(NSString *msg))failure;

#pragma mark -树结构

+(WHTreeManager *)getTreeDatasWtihArr:(NSArray*)arr;
#pragma mark 拼树子节点
+(WHTreeManager *)writeTreeChildWtihArr:(NSArray*)arr
                            treeManager:(WHTreeManager *)treeManager parentID:(NSString*)parentID;
@end

@interface WHBankModel : NSObject

@property (nonatomic,strong)NSString *bankID;//区域标识
@property (nonatomic,strong)NSString *bankName;//区域标识

+(NSArray *)getWHBankModels;

+(NSArray *)getWHBankTitle;

@end




NS_ASSUME_NONNULL_END
